home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 995 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  846 b 

  1. Path: ix.netcom.com!netnews
  2. From: chuckh@ix.netcom.com (Chuck Hamilton)
  3. Newsgroups: comp.lang.c
  4. Subject: printf - adding commas to numbers
  5. Date: Wed, 10 Jan 1996 19:53:17 GMT
  6. Organization: Mercy Health Plan
  7. Message-ID: <4d15eq$lc5@ixnews2.ix.netcom.com>
  8. NNTP-Posting-Host: ix-phi1-10.ix.netcom.com
  9. X-NETCOM-Date: Wed Jan 10 11:52:58 AM PST 1996
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. Is there a simple way with a printf format specifier to add commas to
  13. an integer?
  14.  
  15. For example, if the value of integer i is 12345 I want the output to
  16. be:
  17.  
  18. 12,345.
  19.  
  20. I know this can be done in a function but I'd think that printf ought
  21. to have such capability since it's such a common output format.
  22.  
  23. Please respond via E-mail since I don't check this group often.
  24. --
  25. Chuck Hamilton
  26. chuckh@ix.netcom.com
  27.  
  28. If at first you don't succeed, skydiving isn't for you.
  29.  
  30.